package com.qiyun.duijiang;

import com.qiyun.duijiang.service.*;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.annotation.Resource;

@EnableTransactionManagement
@EnableScheduling
@SpringBootApplication
@MapperScan("com.qiyun.duijiang.dao")
public class DuijiangApplication {

    public static void main(String[] args) {
        SpringApplication.run(DuijiangApplication.class, args);
    }

    /**
     * 竟足开奖
     */
    @Resource
    private FprizeService fprizeService;
    @Scheduled(cron= "0/5 * * * * ?")
    public void drawF(){
        fprizeService.draw();
    }

    /**
     * 竟篮开奖
     */
    @Resource
    private BprizeService bprizeService;
    @Scheduled(cron= "0/5 * * * * ?")
    public void drawB(){
        bprizeService.draw();
    }

    /**
     * 足彩胜负彩
     */
    @Resource
    private ZcsfcprizeService zcsfcprizeService;
    @Scheduled(cron = "0/5 * * * * ?")
    private void drawZcsfc(){
        zcsfcprizeService.draw();
    }

    /**
     * 足彩任选九
     */
    @Resource
    private ZcrjprizeService zcrjprizeService;
    @Scheduled(cron = "0/5 * * * * ?")
    private void drawZcrx9(){
        zcrjprizeService.draw();
    }

    /**
     * 足彩进球彩
     */
    @Resource
    private ZcjqcprizeService zcjqcprizeService;
    @Scheduled(cron = "0/5 * * * * ?")
    private void drawZcjqc(){
        zcjqcprizeService.draw();
    }

    /**
     * 足彩半全场
     */
    @Resource
    private ZcbqcprizeService zcbqcprizeService;
    @Scheduled(cron = "0/5 * * * * ?")
    private void drawZcbqc(){
        zcbqcprizeService.draw();
    }
}
